<?php
/*
 * @Descripttion: 
 * @Author: Shiroi
 * @Date: 2020-08-20 16:03:03
 * @LastEditors: Shiroi
 * @site: https://shiroi.top
 * @mail: 707305003@qq.com
 */
//**********************************案例一(start)**************************************
include_once "FileDownLoad.php";
/**=============================支持以下格式===============================  start  **/
//格式1
$download_config = array(
    'http://image-test.zlzr.com.cn/image/xDPDxt7rCS.png',
    'https://shiroi.top/usr/uploads/2020/08/2043609497.png',
);
//格式2
$download_config = array(
    array('http://image-test.zlzr.com.cn/image/xDPDxt7rCS.png',uniqid() . '.png'),
    array('https://shiroi.top/usr/uploads/2020/08/2043609497.png',uniqid() . '.png'),
);
//格式3
$download_config = array(
    array('http://image-test.zlzr.com.cn/image/xDPDxt7rCS.png'),
    array('https://shiroi.top/usr/uploads/2020/08/2043609497.png'),
);
/**=============================支持以下格式===============================  end  **/
$obj = new FileDownLoad($download_config, 10, 10,'file');
$handle_num = $obj->download();
echo 'download num:'.$handle_num.PHP_EOL;
//**********************************案例一(end)**************************************


//**********************************案例二(start)**************************************
include_once "ImageSpider.php";
//单图片下载器
$img_url = 'https://shiroi.top/usr/uploads/2020/08/2043609497.png';
$obj = new ImageSpider();
$pic_url = $obj->setFileName('1.png')->downloadImage($img_url, 'file')->getUrlPath();
var_dump($pic_url);
//**********************************案例二(end)**************************************
